
return {
    beforePreProcess: function (content, url) {
        //beforePreProcess 页面初始化之前，可在此进行模版修改 or 定义新的参数
       
    },
    beforePageInit: function (page) {
        var self = this
        self.tool.fillDefines= function(order) {
            var orderDefines = cb.cache.get("orderDefines") || {};
            return orderDefines.header && Array.isArray(orderDefines.header) && (order.oOrderDefine || (order.oOrderDefine = {}),
            orderDefines.header.forEach(function(header) {
                order.oOrderDefine[header.name] = header.value,
                "iTransactionTypeId" == header.name && (header.value ? order.iTransactionTypeId = parseInt(header.value) : delete order.oOrderDefine.iTransactionTypeId,
                header.transaction) && header.transaction.id && (order.oTransactionType = {
                    id: header.transaction.id,
                    cName: header.transaction.name
                }),
                "dSendDate" == header.name && (order.dSendDate = header.value)
            })),
            order.oOrderDetails.forEach(function(detail) {
                var detailDefine = orderDefines.body && orderDefines.body.find(function(body) {
                    return body.idKey == detail.idKey,body.define3 = detail.oOrderDetailDefine.define3
                });
                detailDefine ? ((detail.oOrderDetailDefine = detailDefine).iStockId && (detail.iStockId = detailDefine.iStockId),
                detailDefine.stockOrgId && (detail.stockOrgId = detailDefine.stockOrgId),
                detailDefine.dSendDate && (detail.dSendDate = detailDefine.dSendDate),
                detailDefine.iTransactionTypeId && (detail.iTransactionTypeId = parseInt(detailDefine.iTransactionTypeId)),
                detailDefine.transaction && detailDefine.transaction.id && (detail.oTransactionType = {
                    id: detailDefine.transaction.id,
                    cName: detailDefine.transaction.name
                })) : orderDefines.header && (detailDefine = orderDefines.header.find(function(item) {
                    return "iTransactionTypeId" == item.name
                })) && !detail.iTransactionTypeId && (detail.iTransactionTypeId = parseInt(detailDefine.value),
                detail.oTransactionType = {
                    id: detail.iTransactionTypeId,
                    cName: detailDefine.transaction.name
                })
            }),
            order
        }
    },   
    afterPageInit: function (page) {
        // 该事件时  Dom已ready 但已执行当前页面固有逻辑
        console.log('lexus');
    },
    beforePageBack: function (page) {
        // 页面回退之前
    },
    afterPageBack: function (page) {
        // 页面回退之后
    },
    afterFromPageBack: async function(page) {
        var hasChange, selectedProducts, baseInfoData, self = this, pageName = (self.page = page,
        this.temp.page || (this.temp.page = page),
        page.fromPage.name);
        switch (pageName) {
        case "addrNewPage":
            cb.cache.set("address", page.query.addressData),
            self.render(page.query.addressData);
            break;
        case "coupons":
            page.query.isSelect && ((order = this.temp.isHidePrice ? this.cloneOrder : this.newOrder).orderCoupons = page.query.coupon ? [page.query.coupon] : [],
            self.load.calcCoupons.call(self, order));
            break;
        case "useDefines":
            if (page.query.useDefine) {
                var transaction, has, orderDefines = cb.cache.get("orderDefines");
                if (1 == page.query.archiveType ? (orderDefines.header.forEach(function(header) {
                    header.value = page.query.useDefine[header.name],
                    "iTransactionTypeId" == header.name && header.value && (header.isTransaction = !0,
                    header.transaction = page.query.useDefine.transaction)
                }),
                cb.FunctionOptions.PRODUCTREADYDATE && page.query.useDefine.dSendDate && (self.newOrder.dSendDate = page.query.useDefine.dSendDate,
                orderDefines.body) && orderDefines.body.map(function(item) {
                    if (!item.dSendDate) {
                        item.dSendDate = page.query.useDefine.dSendDate;
                        var attr, valStr = [item.dSendDate];
                        for (attr in item) {
                            var attrValue = item[attr];
                            !attrValue || 0 <= ["id", "idKey", "iStockId", "stockOrgId", "iTransactionTypeId", "iComPreGroupId", "iSKUId", "requiredType"].indexOf(attr) || valStr.push("object" == typeof attrValue ? attrValue.name : attrValue)
                        }
                        self.dataPage.find('.body-define[data-idkey="' + item.idKey + '"]').find("p:first-child").text(valStr.join(";"))
                    }
                }),
                page.query.useDefine.transaction && (transaction = page.query.useDefine.transaction,
                orderDefines.body) && orderDefines.body.forEach(function(body) {
                    var rowText;
                    body.iTransactionTypeId ? (body.iTransactionTypeId = transaction.id,
                    body.transaction = transaction,
                    (rowText = []).push(transaction.name)) : (body.iTransactionTypeId = transaction.id,
                    body.transaction = transaction,
                    (rowText = (rowText = self.dataPage.find('div[data-idkey="' + body.idKey + '"]').find("p").text()) ? rowText.split(";") : []).indexOf(transaction.name) < 0 && rowText.push(transaction.name)),
                    self.dataPage.find('div[data-idkey="' + body.idKey + '"]').find("p:first-child").text(rowText.join(";"))
                })) : 2 == page.query.archiveType && (orderDefines.body ? (has = !1,
                orderDefines.body.map(function(item, index) {
                    item.idKey == page.query.useDefine.idKey && (orderDefines.body[index] = page.query.useDefine,
                    cb.FunctionOptions.PRODUCTREADYDATE && orderDefines.body[index].dSendDate && orderDefines.header && orderDefines.header.map(function(header) {
                        "dSendDate" == header.name && (header.value = header.value ? cb.utils.FloatCalc.compareDate(header.value, page.query.useDefine.dSendDate) : page.query.useDefine.dSendDate)
                    }),
                    has = !0)
                }),
                has || orderDefines.body.push(page.query.useDefine)) : orderDefines.body = [page.query.useDefine]),
                cb.cache.set("orderDefines", orderDefines),
                self.render("headerDefine"),
                2 == page.query.archiveType) {
                    var requireArr = self.tool.getRequiredDefine.call(self)
                      , valStr = [];
                    for (attr in page.query.useDefine) {
                        var attrValue = page.query.useDefine[attr];
                        "id" != attr && "idKey" != attr && "iStockId" != attr && "stockOrgId" != attr && "iTransactionTypeId" != attr && "iComPreGroupId" != attr && "iSKUId" != attr && "requiredType" != attr && ("object" == typeof attrValue ? valStr.push(attrValue.name) : 0 == attr.indexOf("define") && (requireArr.find(function(v) {
                            return v.name == attr
                        }) ? valStr.push('<span style="color:#ff9e06;">*</span>' + self.tool.getDefineTitle.call(self, attr) + ":" + attrValue) : attrValue && valStr.push(self.tool.getDefineTitle.call(self, attr) + ":" + attrValue)))
                    }
                    for (attr in page.query.useDefine) {
                        attrValue = page.query.useDefine[attr];
                        "id" != attr && "idKey" != attr && "iStockId" != attr && "stockOrgId" != attr && "iTransactionTypeId" != attr && "iComPreGroupId" != attr && "iSKUId" != attr && "requiredType" != attr && attrValue && "object" != typeof attrValue && -1 == attr.indexOf("define") && valStr.push("dSendDate" == attr ? lang.templateByUuid("UID:P_UDHMC_17EC591E0588016A", "预计发货日期") + ":" + attrValue : attrValue)
                    }
                    page.query.container.html("<p>" + valStr.join(";") + '</p><p class="more">' + lang.templateByUuid("UID:P_UDHMC_17EC591E0588016C", "更多") + "</p>")
                }
            }
            page.query.isChangeNum && (order = self.temp.isHidePrice ? self.cloneOrder : self.newOrder,
            self.load.defineFormula.call(self, order)),
            page.query.isOutUrl && page.query.order && self.tool.outRender.call(self, page.query.order),
            "u8c" == cb.rest.runtime.env && page.query && page.query.useDefine && page.query.useDefine.stockOrgId && 2 == page.query.archiveType && self.newOrder.indispensablyPricingDimension && -1 < self.newOrder.indispensablyPricingDimension.indexOf("stockOrgId") && self.load.computePromotion.call(self);
            break;
        case "addrListPage":
            if (page.query.addressData && page.query.addressData.iReceiveId)
                if ("product" === page.query.source)
                    self.newOrder.oOrderDetails = self.newOrder.oOrderDetails.map(function(item) {
                        return item.iProductId === page.query.pid && item.iSKUId === page.query.skuid && item.idKey === page.query.idKey && (item.receiveAddress = page.query.addressData.cReceiveAddress,
                        item.receiveId = page.query.addressData.iReceiveId,
                        item.receiveMobile = page.query.addressData.cReceiveMobile,
                        item.receiver = page.query.addressData.cReceiver,
                        item.receiveZipCode = page.query.addressData.receiveZipCode,
                        item.receiveTelePhone = page.query.addressData.receiveTelePhone,
                        self.selectors.productDetailContainer.find('.receiveAddress[data-idkey="' + item.idKey + '"] .receiveAddressSpan').html(item.receiveAddress)),
                        item
                    });
                else {
                    const preAddress = cb.cache.get("address");
                    cb.cache.set("address", page.query.addressData),
                    self.render("address"),
                    self.newOrder.oOrderDetails = self.newOrder.oOrderDetails.map(function(item) {
                        return item.receiveId ? preAddress.iReceiveId === item.receiveId && (item.receiveAddress = page.query.addressData.cReceiveAddress,
                        item.receiveId = page.query.addressData.iReceiveId,
                        item.receiveMobile = page.query.addressData.cReceiveMobile,
                        item.receiver = page.query.addressData.cReceiver,
                        item.receiveZipCode = page.query.addressData.receiveZipCode,
                        item.receiveTelePhone = page.query.addressData.receiveTelePhone,
                        self.selectors.productDetailContainer.find('.receiveAddress[data-idkey="' + item.idKey + '"] .receiveAddressSpan').html(item.receiveAddress)) : (item.receiveAddress = page.query.addressData.cReceiveAddress,
                        item.receiveId = page.query.addressData.iReceiveId,
                        item.receiveMobile = page.query.addressData.cReceiveMobile,
                        item.receiver = page.query.addressData.cReceiver,
                        item.receiveZipCode = page.query.addressData.receiveZipCode,
                        item.receiveTelePhone = page.query.addressData.receiveTelePhone,
                        self.selectors.productDetailContainer.find('.receiveAddress[data-idkey="' + item.idKey + '"] .receiveAddressSpan').html(item.receiveAddress)),
                        item
                    })
                }
                let obj = {
                    customer: cb.rest.appContext.context.agentId,
                    deliveryMethod: '厂送',
                    receiveAddress: page.query.addressData.cReceiveAddress,
                    productDetail: [],
                }
                self.newOrder.oOrderDetails.forEach(element => {
                    let product = {
                    productCode: '',
                    productId: element.iProductId,
                    org: element.salesOrgId,
                    priceQty: element.iQuantity,
                    productUnitId: element.productUnitId,
                    currency: '1655486829428736015',
                    stockId: ''
                    }
                    obj.productDetail.push(product)
                });
                let getPrice = function(){
                    return new Promise((resolve, reject) => {
                        cb.rest.postCross({
                            url: "https://saas.hlhs-bip.com/iuap-api-gateway/ajxbewdh/AcquisitionPrice/GetPriceAndFreight/pricing/acquisitionPrice?appKey=a4dc65b0fbab4f68a56e8054999a2ab3",
                            params: obj,
                            type:'post',
                            success: (res) => {
                                resolve(res.data)
                            },
                            error: function(errRes) {
                                console.log('errRes', errRes);
                            }
                        })
                    })
                }
                let list = await getPrice()
                self.newOrder.oOrderDetails.forEach((item,index) => {
                    list[item.iProductId].freight = parseFloat(list[item.iProductId].freight)
                    list[item.iProductId].freight = 55
                    item.fTransactionPrice += list[item.iProductId].freight 
                    item.fSalePayMoney += list[item.iProductId].freight *item.iQuantity //含税金额
                    item.modifyPriceStatus = 1
                    item.oOrderDetailDefine.define3 = list[item.iProductId].freight 
                  })
                self.load.computePromotion.call(self, {
                    isAddCart: !1
                });
            break;
        case "storeAddrListPage":
            page.query.storeAddressData && page.query.storeAddressData.iReceiveId && (self.newOrder.receiveStoreId = page.query.storeAddressData.receiveStoreId,
            self.newOrder.receiveStoreName = page.query.storeAddressData.receiveStoreName,
            self.newOrder.receiveStoreCode = page.query.storeAddressData.receiveStoreCode,
            cb.cache.set("storeAddress", page.query.storeAddressData),
            self.render("storeAddress"),
            cb.rest.getJSON({
                url: cb.router.HTTP_AGENT_GETAGENT_ADDRESS.format(page.query.storeAddressData.iReceiveId),
                success: function(data) {
                    data = data.data,
                    data.address = data.address || "",
                    data.cDistrct = [data.country, data.province, data.city, data.area].join(" "),
                    data = {
                        iReceiveId: data.id,
                        cReceiver: data.receiver,
                        cReceiveMobile: data.mobile,
                        stockName: data.stockName,
                        cReceiveAddress: data.cDistrct + data.address,
                        cReceiveZipCode: data.zipCode,
                        receiveCountryCode: data.countryCode || "86"
                    };
                    cb.cache.set("address", data),
                    self.render("address")
                }
            }),
            self.load.computePromotion.call(self, {
                isAddCart: !1
            }));
            break;
        case "BaseInfo":
            page.query.baseInfoData && (page.query.baseInfoData.isHideSendData = cb.FunctionOptions.SHOWHOPERERECEIVEDATE,
            baseInfoData = cb.cache.get("baseInfo"),
            hasChange = !1,
            order = self.temp.isHidePrice ? self.cloneOrder : self.newOrder,
            self.tool.isShowRegiht.call(self) && baseInfoData.fReight != page.query.baseInfoData.fReight && (hasChange = !0,
            order.fReight = (void 0 === page.query.baseInfoData.fReight ? order : page.query.baseInfoData).fReight),
            baseInfoData.dOrderDate != page.query.baseInfoData.dOrderDate && (hasChange = !0,
            order.dOrderDate = page.query.baseInfoData.dOrderDate),
            (hasChange = "u8c" == cb.rest.runtime.env && baseInfoData.iCorpContactId != page.query.baseInfoData.iCorpContactId && order.indispensablyPricingDimension && -1 < order.indispensablyPricingDimension.indexOf("iCorpContactId") ? !0 : hasChange) && self.load.computePromotion.call(self),
            cb.cache.set("baseInfo", page.query.baseInfoData),
            self.render("baseInfo"));
            break;
        case "invoiceList":
            if (page.query.invoiceData) {
                if (cb.cache.get("invoice").cInvoiceType != page.query.invoiceData.cInvoiceType) {
                    var attr, order = self.temp.isHidePrice ? self.cloneOrder : self.newOrder;
                    for (attr in page.query.invoiceData)
                        order.hasOwnProperty(attr) && (order[attr] = page.query.invoiceData[attr]);
                    self.load.computePromotion.call(self, {
                        isAddCart: !1,
                        isChangeTax: !0
                    })
                }
                cb.cache.set("invoice", page.query.invoiceData),
                self.render("invoice")
            }
            break;
        case "payment":
            page.query.paymentData && (baseInfoData = cb.cache.get("paywayandshipping"),
            hasChange = !1,
            order = self.temp.isHidePrice ? self.cloneOrder : self.newOrder,
            baseInfoData.settlementuid != page.query.paymentData.settlementuid && order.indispensablyPricingDimension && -1 < order.indispensablyPricingDimension.indexOf("iSettlementId") && (hasChange = !0),
            baseInfoData.shippingid != page.query.paymentData.shippingid && order.indispensablyPricingDimension && -1 < order.indispensablyPricingDimension.indexOf("shippingChoiceId") && (hasChange = !0),
            baseInfoData.paywayCode && baseInfoData.paywayCode != page.query.paymentData.paywayCode && order.indispensablyPricingDimension && -1 < order.indispensablyPricingDimension.indexOf("cOrderPayType") && (hasChange = !0),
            cb.cache.set("paywayandshipping", page.query.paymentData),
            self.render("paywayandshipping"),
            order.oShippingChoice = {
                cCode: page.query.paymentData.shippingCode,
                cName: page.query.paymentData.shippingName,
                id: page.query.paymentData.shippingId || ""
            },
            hasChange) && "u8c" == cb.rest.runtime.env && self.load.computePromotion.call(self);
            break;
        case "viewRemarks":
            if (page.query.remark) {
                self.remarkList = page.query.remark;
                for (var i = 0; i < self.newOrder.oOrderDetails.length; i++)
                    for (var j = 0; j < self.remarkList.length; j++)
                        self.newOrder.oOrderDetails[i].iSKUId != self.remarkList[j].skuid || self.remarkList[j].idKey && self.remarkList[j].idKey != self.newOrder.oOrderDetails[i].idKey || (self.newOrder.oOrderDetails[i].cMemo = self.remarkList[j].val)
            }
            break;
        case "addMessage":
            page.query.submit && cb.rest.getJSON({
                url: cb.router.HTTP_ORDER_FINDORDERMEMOS,
                params: {
                    cOrderNo: self.newOrder.cOrderNo,
                    pageSize: 999
                },
                success: function(data) {
                    var cloneOrder = cb.utils.extend(!0, {}, self.newOrder)
                      , data = (cloneOrder.oOrderMemos = data.data,
                    cloneOrder.isHidePrice = self.temp.isHidePrice,
                    cloneOrder.fRebateTotalMoney = self.selectors.rebateContainer.find("#spanUseableM").text(),
                    cloneOrder.isHideMondiyDetail = cloneOrder.cSeparatePromotionType && "old" == cloneOrder.cSeparatePromotionType,
                    (cloneOrder = self.tool.choosePromotions.call(self, cloneOrder)).isShowRebate = "u8c" != cb.rest.runtime.env,
                    cloneOrder.isYs = "u8c" === cb.rest.runtime.env,
                    cloneOrder.agentUseRebate = self.context.agentUseRebate,
                    self.productPartInfoFunc(cloneOrder));
                    self.selectors.rebateContainer.html(data),
                    self.selectors.rebateContainer.find("#spanUseableM").text(cloneOrder.fRebateTotalMoney),
                    self.load.rebate.call(self, cloneOrder)
                }
            });
            break;
        case "allMessage":
            page.query.cOrderNo && cb.rest.getJSON({
                url: cb.router.HTTP_ORDER_FINDORDERMEMOS,
                params: {
                    cOrderNo: page.query.cOrderNo,
                    pageSize: 999
                },
                success: function(data) {
                    var cloneOrder = cb.utils.extend(!0, {}, self.newOrder)
                      , data = (cloneOrder.oOrderMemos = data.data,
                    cloneOrder.isHidePrice = self.temp.isHidePrice,
                    cloneOrder.isHideMondiyDetail = cloneOrder.cSeparatePromotionType && "old" == cloneOrder.cSeparatePromotionType,
                    cloneOrder.fRebateTotalMoney = self.selectors.rebateContainer.find("#spanUseableM").text(),
                    (cloneOrder = self.tool.choosePromotions.call(self, cloneOrder)).isShowRebate = "u8c" != cb.rest.runtime.env,
                    cloneOrder.isYs = "u8c" === cb.rest.runtime.env,
                    cloneOrder.agentUseRebate = self.context.agentUseRebate,
                    self.productPartInfoFunc(cloneOrder));
                    self.selectors.rebateContainer.html(data),
                    self.selectors.rebateContainer.find("#spanUseableM").text(cloneOrder.fRebateTotalMoney),
                    self.load.rebate.call(self, cloneOrder)
                }
            });
        case "attachmentManage":
        case "EnclosureListModify":
            var timer = null;
            if (page.query.files && page.query.files.length)
                self.newOrder.oAttachments = page.query.files,
                self.temp.isHidePrice && (self.cloneOrder.oAttachments = page.query.files),
                self.dataPage.find(".enclosure .item-title.num-title").html(lang.templateByUuid("UID:P_UDHMC_17EC591E05880169", "附件") + "(" + page.query.files.length + ")");
            else {
                if (self.dataPage.find(".enclosure .item-title.num-title").html(lang.templateByUuid("UID:P_UDHMC_17EC591E05880169", "附件") + "(0)"),
                self.dataPage.find(".enclosure #fileChange").html(""),
                timer)
                    return !1;
                timer = setTimeout(function() {
                    timer = null;
                    var newFileInput = document.createElement("input");
                    newFileInput.setAttribute("type", "file"),
                    newFileInput.className = "fileInput",
                    newFileInput.name = "file",
                    newFileInput.id = "file",
                    self.dataPage.find(".enclosure").append(newFileInput)
                }, 100)
            }
            break;
        case "UcEnclosureListModify":
            page.query.oldObjectId && (self.oldObjectId = page.query.oldObjectId);
            break;
        case "rebateSelect":
            if (0 == page.query.isAutoUseRebate && (self.newOrder.isAutoUseRebate = page.query.isAutoUseRebate),
            page.query.rebateData) {
                cb.cache.set("rebateAmount", page.query.rebateData);
                var param = {
                    order: self.temp.isHidePrice ? self.cloneOrder : self.newOrder
                };
                if (cb.cache.get("order") && (param.order = cb.cache.get("order")),
                Array.isArray(page.query.rebateData.resultArray)) {
                    if (self.tool.mergeOrderRebate.call(self, param.order, page.query.rebateData.resultArray),
                    param.order.fRebateMoney = 0,
                    param.order.fRebateCashMoney = 0,
                    param.order.oRebates)
                        for (i = 0; i < param.order.oRebates.length; i++)
                            "NUMBERPRODUCT" != (attrValue = param.order.oRebates[i]).cUseWayCode && "AMOUNTPRODUCT" != attrValue.cUseWayCode && ("TOCASH" != attrValue.cUseWayCode ? param.order.fRebateMoney = cb.utils.FloatCalc.add(param.order.fRebateMoney, attrValue.fOrderRebateMoney) : param.order.fRebateCashMoney = cb.utils.FloatCalc.add(param.order.fRebateCashMoney, attrValue.fOrderRebateMoney));
                    param.order.oOrderDetails.forEach(function(detail) {
                        detail.idKey || (detail.idKey = cb.utils.getGUID()),
                        "REBATE" == detail.cOrderProductType && (param.order.fRebateMoney = cb.utils.FloatCalc.add(param.order.fRebateMoney, detail.fSaleCost))
                    })
                }
                self.selectors.rebateContainer.find("#spanUseableM").text(cb.utils.FloatCalc.add(param.order.fRebateMoney, param.order.fRebateCashMoney)),
                param.order = self.tool.fillDefines(param.order),
                self.load.calcOrderRebate.call(self, {
                    loadRebate: !0,
                    order: param.order
                })
            }
            page.query.isCheck && self.selectors.rebateContainer.find(".rebateClass").length && "u8c" == cb.rest.runtime.env && (self.selectors.rebateContainer.find(".rebateClass")[0].checked = !0);
            break;
        case "commodtyList":
            page.query.selectedProducts && page.query.selectedProducts.length && (order = self.temp.isHidePrice ? self.cloneOrder : self.newOrder,
            baseInfoData = (selectedProducts = self.tool.convertProduct(page.query.selectedProducts)).find(function(item) {
                return "GIFT" != item.cOrderProductType
            }),
            order.isOnlyEditUserAddGiveaway = !baseInfoData,
            "u8c" !== cb.rest.runtime.env && selectedProducts.forEach(function(item) {
                item.fSalePrice && (item.fTransactionPrice = item.fSalePrice)
            }),
            page.query.selectedProducts.map(sku=>{
                var step, Index = order.oOrderDetails.findIndex(v=>!("D" === v.actionStatus || "SALE" !== v.cOrderProductType || sku.defaultSkuId !== v.iSKUId && sku.lsProductSkus[0].id !== v.iSKUId || sku.iProductId !== v.iProductId || v.selectFreeGroupId || v.suiteGroup || "yonbip-hy-smk-ausa.ausa_auction_bill_card" === v.source));
                -1 < Index ? ((Index = order.oOrderDetails[Index]).iQuantity = Number(Index.iQuantity) + Number(sku.lsProductSkus[0].iQuantity),
                sku.enquiryQuintuple && (step = Math.ceil(cb.utils.FloatCalc.numDiv(Index.iQuantity, sku.enquiryQuintuple)) || 1,
                Index.iQuantity = cb.utils.FloatCalc.numMulti(sku.enquiryQuintuple, step)),
                sku.oProductAuxUnit && (Index.iAuxUnitQuantity = cb.utils.FloatCalc.divide(Index.iQuantity, sku.oProductAuxUnit.iConversionRate))) : order.oOrderDetails.push.apply(order.oOrderDetails, selectedProducts)
            }
            ),
            order.oOrderDetails = self.tool.mergeOrderDetails.call(self, order.oOrderDetails),
            (order = self.tool.mergeOrderGroup(order)).bClearGiveaway = !0,
            self.load.computePromotion.call(self));
            break;
        case "fareGiftPage":
            if (page.query.order) {
                order = page.query.order;
                if (self.remarkList)
                    for (i = 0; i < order.oOrderDetails.length; i++)
                        for (j = 0; j < self.remarkList.length; j++)
                            order.oOrderDetails[i].iSKUId == self.remarkList[j].skuid && (order.oOrderDetails[i].cMemo = self.remarkList[j].val);
                order.isOnlyEditUserAddGiveaway = !1,
                self.temp.isHidePrice ? self.cloneOrder = order : self.newOrder = order,
                self.load.computePromotion.call(self)
            }
            break;
        case "combineEdit":
            var combine = page.query.combine
              , group = null;
            if (combine) {
                for (i = 0; i < self.newOrder.oOrderDetailGroups.length; i++)
                    self.newOrder.oOrderDetailGroups[i].iComPromotionGroupId === combine.id && (group = self.newOrder.oOrderDetailGroups[i]);
                for (i = 0; i < self.newOrder.oOrderDetails.length; i++)
                    self.newOrder.oOrderDetails[i].iGroupIndex === group.index && (self.newOrder.oOrderDetails.splice(i, 1),
                    i--);
                upcommon.thunks.compose(upcommon.thunks.product.total)(combine.lsProes, {
                    hidePrice: self.temp.isHidePrice
                }),
                combine.lsProes.forEach(function(item) {
                    item.oProduct.lsProductSkus.forEach(function(itemm) {
                        for (var key in itemm.oProduct = {},
                        item.oProduct)
                            item.oProduct.hasOwnProperty(key) && "lsProductSkus" !== key && (itemm.oProduct[key] = item.oProduct[key]);
                        var o = {
                            cOrderProductType: "SALE",
                            iSKUId: itemm.id,
                            iProductId: item.oProduct.id,
                            iQuantity: itemm.iQuantity,
                            oSKU: itemm,
                            cProductCode: cb.FunctionOptions.QUICKORDERISSHOWPRODUCTCODE && item.oProduct.cCode,
                            model: cb.FunctionOptions.PACKAGESPECIFICATIONS && item.oProduct.model,
                            modelDescription: cb.FunctionOptions.PRODUCTSPECIFICATION && item.oProduct.modelDescription,
                            cProductName: item.oProduct.cName,
                            cSpecDescription: itemm.cSpecDescription,
                            fSalePrice: itemm.fSalePrice,
                            fTransactionPrice: itemm.fTransactionPrice,
                            fSaleCost: itemm.fSaleCost,
                            fSalePayMoney: itemm.__total,
                            iComPreGroupId: itemm.iComPreGroupId,
                            iMinOrderQuantity: itemm.iMinOrderQuantity,
                            cErpCode: item.oProduct.cERPCode,
                            iAuxUnitQuantity: itemm.iAuxUnitQuantity,
                            cProductUnitName: item.oProduct.oUnit.cName,
                            cProductAuxUnitName: itemm.oProductAuxUnit ? itemm.oProductAuxUnit.oUnit.cName : "",
                            iGroupIndex: group.index,
                            bizId: itemm.bizId,
                            bizProductId: itemm.bizProductId,
                            bizSkuId: itemm.bizSkuId,
                            saleOrgId: itemm.saleOrgId,
                            salesOrgId: itemm.saleOrgId,
                            cProductImgUrl: item.oProduct.imgUrl
                        };
                        itemm.oProductAuxUnit && (o.iConversionRate = itemm.iConversionRate),
                        self.newOrder.oOrderDetails.push(o)
                    })
                }),
                self.load.computePromotion.call(self)
            }
            break;
        case "suiteGroup":
            var suitData = page.query.suiteGroupData
              , group = null;
            if (suitData) {
                for (i = 0; i < self.newOrder.oOrderDetailGroups.length; i++)
                    self.newOrder.oOrderDetailGroups[i].suiteGroup === suitData.suiteGroup && (group = self.newOrder.oOrderDetailGroups[i]);
                suitData.products.forEach(function(item) {
                    item.SkuSpecItems.forEach(function(itemm) {
                        var orderDetail = self.newOrder.oOrderDetails.find(function(v) {
                            return itemm.iSKUId == v.oSKU.id && item.iProductId == v.iProductId && v.suiteGroup === group.suiteGroup
                        });
                        orderDetail.iQuantity = itemm.iQuantity,
                        orderDetail.iAuxUnitQuantity = itemm.iAuxUnitQuantity
                    })
                }),
                self.newOrder.orderDetailGroupSuiteVos.find(function(v) {
                    return v.suiteGroup === suitData.suiteGroup
                }).suiteQty = suitData.suiteQty,
                self.load.computePromotion.call(self)
            }
        }
        "home" != pageName && self.load.storeOrder.call(self)
    },
};